/*
 * @Author: Jiraiya
 * @Date: 2020-03-30 20:13:25
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-03-31 15:18:46
 * @Description: 
 */
/*
 * @Author: Jiraiya
 * @Date: 2020-03-30 17:20:58
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-03-30 17:21:24
 * @Description: 
 */
import * as React from 'react';
import Loadable from './Loadable';
import Loading from './loading';

const ComponentC = Loadable({
    loader: () => import(
        /* webpackChunkName: 'componentC' */
        './componentC.js'),
    loading: Loading, //异步组件未加载之前loading组件
    delay: 1000, //异步延迟多久再渲染
    timeout: 1000, //异步组件加载超时
})

export default function StockChart(props){
    const [isDisplay, setIsDisplay] = React.useState(false);
    if(isDisplay){
        return <React.Fragment>
            <h1>B组件</h1>
            <ComponentC />
        </React.Fragment>
    }else{
        return <input type='button' value='点我' onClick={()=>{setIsDisplay(true)}}/>
    }
}